<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body{
      background: url(img/5.png) no-repeat center top ;
    }
    .a{
      width: 600px;
      height: 100px;
      margin: 0px auto;
      background-color: beige;
    }
    .b{
      float: left;
      margin: 5px 5px;
    }
    .b img{
      float: left;
      width: 180px;
      height: 80px;
    }
  </style>
</head>
<body>
  <div class="a">
    <div class="b"><img src="img/5.png"></div>
    <div class="b"><img src="img/6.png"></div>
    <div class="b"><img src="img/7.png"></div>
  </div>
  <script>
    var img = document.querySelector('.a').querySelectorAll('img');
    for(var i=0;i<img.length;i++)
    {
      img[i].onmousemove = function()
      {
        document.body.style.backgroundImage ='url('+ this.src +')';
      }
    }
  </script>
</body>
</html>